package y2016.date1013.pm.取得lib名称;

import java.io.File;
import java.io.FilenameFilter;

public class LibsName {
    public static String libraryjars = "-libraryjars libs/";

    public static String[] getLibs(String path) {
        File file = new File(path);
        String[] filePathList = file.list(new FilenameFilter() {

            @Override
            public boolean accept(File f, String name) {
                if (name.endsWith(".jar") || name.endsWith(".so")) {
                    System.out.println(name);
                    return true;
                }
                return false;
            }
        });
        return filePathList;
    }

    public static String[] getAddString(String path, String str) {
        String[] libsPath = getLibs(path);
        String[] addStrs = new String[libsPath.length];

        for (int i = 0; i < libsPath.length; i++) {
            addStrs[i] = str + libsPath[i];
            System.out.println(addStrs[i]);
        }
        return addStrs;
    }
}


